<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel common\models\searchs\SearchTlPaymentLog */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '通联交易日志';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="tl-payment-log-index">
 	<?= common\components\grid\GridView2015::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
    	'title' => $this->title,
    	'panel' => [
    		'before' => Html::a('<i class="glyphicon glyphicon-remove"></i> 清空日志', ['clear'], ['class' => 'btn btn-success', 'style' => 'margin-left:20px;'])
    	],
        'columns' => [
            ['class' => 'common\components\grid\CheckboxColumn2015'],
            ['class' => 'common\components\grid\SerialColumn2015'],
     		
//      		'_id',
            'order_id',
 			[
 			'attribute' => 'pay_amount',
 			'value'=>function($searchModel){ return number_format($searchModel->pay_amount/100,2);}
 			],
 			[
 			'attribute' => 'orderDatetime',
 			'value'=>function($searchModel){ return date('Y-m-d H:i:s',strtotime($searchModel->orderDatetime));}
 			],
 			[
 			'attribute' => 'payDatetime',
 			'value'=>function($searchModel){ return date('Y-m-d H:i:s',strtotime($searchModel->payDatetime));}
 			],
            'payResult',
            'key',
            [
     		'attribute' => 'log_time',
     		'value'=>function($searchModel){ return date('Y-m-d H:i:s', $searchModel->log_time);}
     		],

            [
            	'class' => 'common\components\grid\ActionColumn2015',
            	'template' => '{view}',
    		]
        ],
   	 ]); ?>
</div>
